<h1>Edit School</h1>
<?php
$forward = $mvc->getObject('forward');
if (isset($forward)){
?>
	<span class="message warning">Successfully Saved.</span>
<?php } ?>
<?php $schList = $mvc->getObject('result'); if($schList == NULL){ ?>
	<span class="message warning">
		Oops... seems the address you have entered is invalid. There are no schools for such criterias.<br />
		But you may still find some schools of interest by browsing our <a href="/schools.html" title="Schools">Schools</a> directory.
	</span>
<?php } else { ?>
<?php	$errors = $mvc->getObject(UsersService::ERROR);
		if (isset($errors)){?>
			<div class="error">
				<ul>
<?php			foreach ($errors as $key => $value){
					echo '<li>' . $value . '</li>'; }?>
				</ul>
			</div>
<?php 	} ?>
	<form enctype="multipart/form-data" action="edit-school.html" method="post" class="edit">
		<span>School Name:</span>
		<input type="text" name="caption" id="caption" size="35" value="<?php echo $schList[SchoolService::CAPTION]; ?>"/>
		<div class="clnr brdr">&nbsp;</div>
		<span>Description:</span>
		<textarea rows="10" cols="28"  name="description" id="description"><?php echo $schList[SchoolService::DESCRIPTION]; ?></textarea>
		<div class="clnr brdr">&nbsp;</div>
		<span>Avatar(80x80) :</span>
		<img alt="none avatar" src="<?php echo $schList[SchoolService::AVATAR]; ?>">
		<input type="file" name="file" size="30" ></input>
		<div class="clnr brdr">&nbsp;</div>
		<input type="hidden" name="alias" id="alias" value="<?php echo $schList[SchoolService::ALIAS]; ?>"/>
 		<input type="hidden" name="id" value="<?php echo $schList[SchoolService::ID]; ?>"/>
		<p class="btns"><input type="submit" name="submit" value="Submit Changes" class="defBtn" /></p>
	</form>	
<?php } ?>